#Makefile for source files

include ../mkfls_profs/Makefile.in
#include $(source_path)/MakefileCheb.in
#include $(source_path)/MakefileCheb_precise.in
#include $(source_path)/MakefileBG.in
#include $(nh3d_path)/mkl_seq_link.in
#mkl_include = -I $(MKLROOT)/include/64

objfiles=\
 $(objfile_path)/inmsoil_driver.o \
 $(objfile_path)/allocvar_mpi_sub.o \
 $(objfile_path)/check_unit0_sub.o  \
 $(objfile_path)/qsat_func.o  \
 $(objfile_path)/esat_func.o  \
 $(objfile_path)/optwarnstop_sub.o  \
 $(objfile_path)/fext_func.o  \
 $(objfile_path)/wrigrd_sub.o  \
 $(objfile_path)/extrah_mpi_sub.o \
 $(objfile_path)/soil_mpi_sub.o \
 $(objfile_path)/tlake_func.o \
 $(objfile_path)/rad_par2_sub.o \
 $(objfile_path)/tsoil_func.o \
 $(objfile_path)/rad_mpi_sub.o \
 $(objfile_path)/readgrd_sub.o \
 $(objfile_path)/ireadgrd_sub.o \
 $(objfile_path)/eps1_func.o \
 $(objfile_path)/epsil_func.o \
 $(objfile_path)/read_ERA.o \
 $(objfile_path)/surfto3d_sub.o

 # $(objfile_path)/fft_intel_init_sub.o


 all : $(objfiles)

# Compiling source files
 $(objfile_path)/%.o : %.f90
	$(f90comp) $(opt_keys) $(check_keys) $(include_keys) $(formfree_key) $(mkl_include) $(keys) $< -o $@

 $(objfile_path)/%.o : %.F90
	$(f90comp) $(opt_keys) $(check_keys) $(include_keys) $(formfree_key) $(keys) $< -o $@

 $(objfile_path)/%.o : %.f
	$(f90comp) $(opt_keys) $(check_keys) $(include_keys) $(formfixed_key) $(keys) $< -o $@

# Cleaning *.o and *.mod files
 clean : 
	rm -f $(objfiles)
